/******************************************************************************* 
 *  Copyright 2007 Amazon Technologies, Inc.  
 *  Licensed under the Apache License, Version 2.0 (the "License"); 
 *  
 *  You may not use this file except in compliance with the License. 
 *  You may obtain a copy of the License at: http://aws.amazon.com/apache2.0
 *  This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 
 *  CONDITIONS OF ANY KIND, either express or implied. See the License for the 
 *  specific language governing permissions and limitations under the License.
 * ***************************************************************************** 
 *    __  _    _  ___ 
 *   (  )( \/\/ )/ __)
 *   /__\ \    / \__ \
 *  (_)(_) \/\/  (___/
 * 
 *  Amazon ECS CSharp Library
 *  API Version: 2007-07-16
 *  Generated: Thu Aug 02 10:15:38 PDT 2007 
 * 
 */

using System;
using System.Xml.Serialization;
using System.Collections.Generic;
using System.Text;


namespace Amazon.ECS.Model
{
    [XmlTypeAttribute(Namespace = "http://webservices.amazon.com/AWSECommerceService/2007-07-16")]
    [XmlRootAttribute(Namespace = "http://webservices.amazon.com/AWSECommerceService/2007-07-16", IsNullable = false)]
    public class ImageSet
    {
    
        private  String categoryField;
        private  Image swatchImageField;
        private  Image smallImageField;
        private  Image thumbnailImageField;
        private  Image tinyImageField;
        private  Image mediumImageField;
        private  Image largeImageField;

        /// <summary>
        /// Gets and sets the SwatchImage property.
        /// </summary>
        [XmlElementAttribute(ElementName = "SwatchImage")]
        public Image SwatchImage
        {
            get { return this.swatchImageField ; }
            set { this.swatchImageField = value; }
        }



        /// <summary>
        /// Sets the SwatchImage property
        /// </summary>
        /// <param name="swatchImage">SwatchImage property</param>
        /// <returns>this instance</returns>
        public ImageSet WithSwatchImage(Image swatchImage)
        {
            this.swatchImageField = swatchImage;
            return this;
        }



        /// <summary>
        /// Checks if SwatchImage property is set
        /// </summary>
        /// <returns>true if SwatchImage property is set</returns>
        public Boolean IsSetSwatchImage()
        {
            return this.swatchImageField != null;
        }




        /// <summary>
        /// Gets and sets the SmallImage property.
        /// </summary>
        [XmlElementAttribute(ElementName = "SmallImage")]
        public Image SmallImage
        {
            get { return this.smallImageField ; }
            set { this.smallImageField = value; }
        }



        /// <summary>
        /// Sets the SmallImage property
        /// </summary>
        /// <param name="smallImage">SmallImage property</param>
        /// <returns>this instance</returns>
        public ImageSet WithSmallImage(Image smallImage)
        {
            this.smallImageField = smallImage;
            return this;
        }



        /// <summary>
        /// Checks if SmallImage property is set
        /// </summary>
        /// <returns>true if SmallImage property is set</returns>
        public Boolean IsSetSmallImage()
        {
            return this.smallImageField != null;
        }




        /// <summary>
        /// Gets and sets the ThumbnailImage property.
        /// </summary>
        [XmlElementAttribute(ElementName = "ThumbnailImage")]
        public Image ThumbnailImage
        {
            get { return this.thumbnailImageField ; }
            set { this.thumbnailImageField = value; }
        }



        /// <summary>
        /// Sets the ThumbnailImage property
        /// </summary>
        /// <param name="thumbnailImage">ThumbnailImage property</param>
        /// <returns>this instance</returns>
        public ImageSet WithThumbnailImage(Image thumbnailImage)
        {
            this.thumbnailImageField = thumbnailImage;
            return this;
        }



        /// <summary>
        /// Checks if ThumbnailImage property is set
        /// </summary>
        /// <returns>true if ThumbnailImage property is set</returns>
        public Boolean IsSetThumbnailImage()
        {
            return this.thumbnailImageField != null;
        }




        /// <summary>
        /// Gets and sets the TinyImage property.
        /// </summary>
        [XmlElementAttribute(ElementName = "TinyImage")]
        public Image TinyImage
        {
            get { return this.tinyImageField ; }
            set { this.tinyImageField = value; }
        }



        /// <summary>
        /// Sets the TinyImage property
        /// </summary>
        /// <param name="tinyImage">TinyImage property</param>
        /// <returns>this instance</returns>
        public ImageSet WithTinyImage(Image tinyImage)
        {
            this.tinyImageField = tinyImage;
            return this;
        }



        /// <summary>
        /// Checks if TinyImage property is set
        /// </summary>
        /// <returns>true if TinyImage property is set</returns>
        public Boolean IsSetTinyImage()
        {
            return this.tinyImageField != null;
        }




        /// <summary>
        /// Gets and sets the MediumImage property.
        /// </summary>
        [XmlElementAttribute(ElementName = "MediumImage")]
        public Image MediumImage
        {
            get { return this.mediumImageField ; }
            set { this.mediumImageField = value; }
        }



        /// <summary>
        /// Sets the MediumImage property
        /// </summary>
        /// <param name="mediumImage">MediumImage property</param>
        /// <returns>this instance</returns>
        public ImageSet WithMediumImage(Image mediumImage)
        {
            this.mediumImageField = mediumImage;
            return this;
        }



        /// <summary>
        /// Checks if MediumImage property is set
        /// </summary>
        /// <returns>true if MediumImage property is set</returns>
        public Boolean IsSetMediumImage()
        {
            return this.mediumImageField != null;
        }




        /// <summary>
        /// Gets and sets the LargeImage property.
        /// </summary>
        [XmlElementAttribute(ElementName = "LargeImage")]
        public Image LargeImage
        {
            get { return this.largeImageField ; }
            set { this.largeImageField = value; }
        }



        /// <summary>
        /// Sets the LargeImage property
        /// </summary>
        /// <param name="largeImage">LargeImage property</param>
        /// <returns>this instance</returns>
        public ImageSet WithLargeImage(Image largeImage)
        {
            this.largeImageField = largeImage;
            return this;
        }



        /// <summary>
        /// Checks if LargeImage property is set
        /// </summary>
        /// <returns>true if LargeImage property is set</returns>
        public Boolean IsSetLargeImage()
        {
            return this.largeImageField != null;
        }





        /// <summary>
        /// Gets and sets  the Category property.
        /// </summary>
        [XmlAttributeAttribute(AttributeName = "Category")]
        public String Category
        {
            get { return this.categoryField ; }
            set { this.categoryField = value; }
        }



        /// <summary>
        /// Sets the Category property
        /// </summary>
        /// <param name="category">Category property</param>
        /// <returns>this instance</returns>
        public ImageSet WithCategory(String category)
        {
            this.categoryField = category;
            return this;
        }



        /// <summary>
        /// Checks if Category property is set
        /// </summary>
        /// <returns>true if Category property is set</returns>
        public Boolean IsSetCategory()
        {
            return this.categoryField  != null;

        }



        /// <summary>
        /// XML fragment representation of this object
        /// </summary>
        /// <returns>XML fragment for this object.</returns>
        /// <remarks>
        /// Name for outer tag expected to be set by calling method. 
        /// This fragment returns inner properties representation only
        /// </remarks>


        protected internal String ToXMLFragment() {
            StringBuilder xml = new StringBuilder();
            if (IsSetSwatchImage()) {
                Image  swatchImage = this.SwatchImage;
                xml.Append("<SwatchImage>");
                xml.Append(swatchImage.ToXMLFragment());
                xml.Append("</SwatchImage>");
            } 
            if (IsSetSmallImage()) {
                Image  smallImage = this.SmallImage;
                xml.Append("<SmallImage>");
                xml.Append(smallImage.ToXMLFragment());
                xml.Append("</SmallImage>");
            } 
            if (IsSetThumbnailImage()) {
                Image  thumbnailImage = this.ThumbnailImage;
                xml.Append("<ThumbnailImage>");
                xml.Append(thumbnailImage.ToXMLFragment());
                xml.Append("</ThumbnailImage>");
            } 
            if (IsSetTinyImage()) {
                Image  tinyImage = this.TinyImage;
                xml.Append("<TinyImage>");
                xml.Append(tinyImage.ToXMLFragment());
                xml.Append("</TinyImage>");
            } 
            if (IsSetMediumImage()) {
                Image  mediumImage = this.MediumImage;
                xml.Append("<MediumImage>");
                xml.Append(mediumImage.ToXMLFragment());
                xml.Append("</MediumImage>");
            } 
            if (IsSetLargeImage()) {
                Image  largeImage = this.LargeImage;
                xml.Append("<LargeImage>");
                xml.Append(largeImage.ToXMLFragment());
                xml.Append("</LargeImage>");
            } 
            return xml.ToString();
        }

        /**
         * 
         * Escape XML special characters
         */
        private String EscapeXML(String str) {
            StringBuilder sb = new StringBuilder();
            foreach (Char c in str)
            {
                switch (c) {
                case '&':
                    sb.Append("&amp;");
                    break;
                case '<':
                    sb.Append("&lt;");
                    break;
                case '>':
                    sb.Append("&gt;");
                    break;
                case '\'':
                    sb.Append("&#039;");
                    break;
                case '"':
                    sb.Append("&quot;");
                    break;
                default:
                    sb.Append(c);
                    break;
                }
            }
            return sb.ToString();
        }




    }

}